package com.ruofeng.app.kotlin.common

import org.beetl.core.Configuration
import org.beetl.core.GroupTemplate
import org.beetl.core.resource.ClasspathResourceLoader
import org.junit.Test


/**
 * Created by 邱鹏 on 2017/8/23.
 */
open class Test {
    @Test
    fun testBtl() {
        val resourceLoader = ClasspathResourceLoader("/btl/kotlinGenerator/")
        val cfg = Configuration.defaultConfiguration()
        val gt = GroupTemplate(resourceLoader, cfg)

        val template = gt.getTemplate("/model.btl")
        val list = listOf<String>("")
        var param = mapOf<String, Any>(
                "package" to "com.ruofeng.app.common",
                "className" to "SysRole",
                "propertyList" to list
        )
        template.binding("param", param)
        val str = template.render()
        println(str)
    }
}